<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title> <#include "head.ftl" />
</head>
<body>
	<div class="body-box">
		<div class="rhead">
			<div class="rpos">当前位置: 商品库 - 列表</div>
			<form class="ropt">
				<input type="button" value="添加" onclick="location.href='${st.domain}/goods/addOrEdit'" />
			</form>
			<div class="clear"></div>
		</div>
		<div style="padding:10px;">
			<div>
				<form id="search_from">
					<input type="hidden" id="catId_1" name="categoryByCatId.catId"
						value="${goods.categoryByCatId.catId}"> <input type="hidden" id="catId_2"
						name="categoryByCatId2.catId" value="${goods.categoryByCatId2.catId}"> <span
						id="catSelectContent"></span> <input type="text" name="searchWord" value="${searchWord}"
						placeholder="关键字" /> <input type="submit" value="查找" />
				</form>
			</div>
			<div class="clear"></div>
		</div>
		<form id="tableForm" method="post">
			<input type="hidden" name="pageNo" value="1" />
			<table class="pn-ltable" style="" width="100%" cellspacing="1" cellpadding="0" border="0">
				<thead class="pn-lthead">
					<tr>
						<th width="20"><input type='checkbox' onclick='Pn.checkbox("ids",this.checked)' />
						</th>
						<th>ID</th>
						<th>商品名称</th>
						<th>类别</th>
						<th>单位</th>
						<th>操作选项</th>
					</tr>
				</thead>
				<tbody class="pn-ltbody">
					<#list goodsList as goods>
					<tr>
						<td><input type='checkbox' name='ids' value='1' />
						</td>
						<td>${goods.goodsId}</td>
						<td><img src="<#if goods.pic?index_of('http')>${st.domain}</#if>${goods.pic}"
							class="atta thumbImage"> <span style="margin-left:10px;">${goods.name}</span>
						</td>
						<td>${goods.categoryByCatId.name}&nbsp;${goods.categoryByCatId2.name}</td>
						<td>${goods.unit}</td>
						<td align="center"><a href="${st.domain}/goods/addOrEdit?goodsId=${goods.goodsId}"
							class="pn-opt">修改</a>
						</td>
					</tr>
					</#list>
				</tbody>
			</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center" class="pn-sp">
						<div id="pageLink" class="pageLinks">${pageLink.linkString}</div></td>
				</tr>
			</table>
		</form>
	</div>
</body>
<script>
	// [need category] 显示分类下拉列表
	var defValue = $("#catId_2").val()?$("#catId_2").val():$("#catId_1").val();
	$("#catSelectContent").categoryComboBox({
		value: defValue,
		onSelect: function(deep, category) {
			$("#catId_" + deep).val(category?category.catId:"");
		}
	});
</script>
</html>